home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User / Virtual User Current Release / Examples / External Tool Templates / CPlus Tool Template / PascalString.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-04  |  18.5 KB  |  761 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Friday, December 12, 1990 at 5:44 PM
  4.     PascalString.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1992
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __PASCALSTRING__
  15. #define __PASCALSTRING__
  16.  
  17. #ifndef __STRING__
  18. #include <String.h>
  19. #endif
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25. // Forward declaration for all the CString classes.
  26. struct CString;
  27. struct CStr255;
  28. struct CStr63;
  29. struct CStr32;
  30. struct CStr31;
  31.  
  32. typedef const unsigned char *ConstStr255Param;
  33. typedef ConstStr255Param ConstStr63Param, ConstStr32Param, ConstStr31Param,
  34.                          ConstStr27Param,ConstStr15Param;
  35.  
  36. typedef const CStr255& ConstCStr255Param;
  37. typedef const CStr63& ConstCStr63Param;
  38. typedef const CStr32& ConstCStr32Param;
  39. typedef const CStr31& ConstCStr31Param;
  40.  
  41. #ifndef __OSUTILS__
  42. #include <OSUtils.h>
  43. #endif
  44.  
  45. //typedef unsigned char Str255[256], Str63[64], Str32[33],
  46. //                      Str31[32], Str27[28], Str15[16], *StringPtr, **StringHandle;
  47.  
  48. // Some constants defining the length of each of the CString types.
  49.  
  50. const short kLengthByte = 1;
  51. const short kBaseLen = 2;
  52. const short kStr255Len = 255;
  53. const short kStr63Len = 63;
  54. const short kStr32Len = 32;
  55. const short kStr31Len = 31;
  56.  
  57. // Some external function declarations so that we don't have to include more than
  58. // the minimal set of header files.
  59.  
  60. pascal char* PLSTRSTR(const CString& str1,
  61.                       const CString& str2);        // From PaslibIntf.p
  62.  
  63.  
  64. //----------------------------------------------------------------------------------------
  65. // CString: Superclass of all Pascal string compatible string classes.
  66. //----------------------------------------------------------------------------------------
  67.  
  68. typedef struct CString *CStringPtr, **CStringHandle;
  69.  
  70. struct CString
  71. {
  72. public:
  73.     unsigned char fStr[kBaseLen];
  74.  
  75. protected:
  76.     void InsertHelper(const CString& insStr,
  77.                       short pos,
  78.                       short maxLength);
  79.     void InsertHelper(const char* insStr,
  80.                       short pos,
  81.                       short maxLength);
  82.  
  83. public:
  84.  
  85.     // Basic length method, inherited by all derived classes. Define one that returns a
  86.     // reference. Can be used as an lvalue and only can be applied to non-const Strings.
  87.  
  88.     inline unsigned char& Length()
  89.     {
  90.         return fStr[0];
  91.     }                                            // for non-const CString
  92.  
  93.  
  94.     inline unsigned char Length() const
  95.     {
  96.         return fStr[0];
  97.     }                                            // for const CString
  98.  
  99.  
  100.     inline Boolean IsEmpty()
  101.     {
  102.         return fStr[0] <= 0;
  103.     }
  104.  
  105.     inline Boolean IsEmpty() const
  106.     {
  107.         return fStr[0] <= 0;
  108.     }
  109.  
  110.     // Character selector operator.
  111.  
  112.     unsigned char& operator[](short pos);            // for non-const CString
  113.                                                     // !!! try to inline later
  114.  
  115.     inline unsigned char operator[](short pos) const
  116.     {
  117.         return fStr[pos];
  118.     }                                            // for const CString
  119.     
  120.     //------------------------------------------------------------------------------------
  121.     // CAUTION: There is a subtle difference between the (char*) and (unsigned char*)
  122.     // converstion operators. The first converts a pascal-style string to a c-style
  123.     // string. The second simply converts between two types (CString and Str55) both of
  124.     // which are pascal-style strings.
  125.     
  126.     // Create a NULL terminated c-style string from a pascal-style CString. Used in
  127.     // debugging to fprintf a CString.
  128.     
  129.     operator char*() const;
  130.     
  131.     // Used to create a toolbox type Str255 from our CString. This is simply a type
  132.     // coersion! Both CString and Str255 are expected to be pascal-style strings.
  133.     
  134.     operator unsigned char*();
  135.     
  136.     operator const unsigned char*() const;
  137.  
  138.     //------------------------------------------------------------------------------------
  139.     
  140.     // Return an ID represented as a CString to the actual ID (a long).
  141.     
  142.     operator long() const;
  143.  
  144.     // Relational operators that are inherited by all the derived CString types. Three of
  145.     // each so that literal C Strings can be conveniently used for one of the operators as
  146.     // well as two of the derive classes as operators. These are declared here but defined
  147.     // below all the CString classes because they use constructors for CStr255 and its class
  148.     // definition has not been encountered yet.
  149.  
  150.     friend Boolean operator==(const CString& s1,
  151.                                      const char* s2);
  152.     friend Boolean operator==(const char* s1,
  153.                                      const CString& s2);
  154.     friend Boolean operator==(const CString& s1,
  155.                                      const CString& s2);
  156.  
  157.     friend Boolean operator!=(const CString& s1,
  158.                                      const char* s2);
  159.     friend Boolean operator!=(const char* s1,
  160.                                      const CString& s2);
  161.     friend Boolean operator!=(const CString& s1,
  162.                                      const CString& s2);
  163.  
  164.     friend Boolean operator>(const CString& s1,
  165.                                     const char* s2);
  166.     friend Boolean operator>(const char* s1,
  167.                                     const CString& s2);
  168.     friend Boolean operator>(const CString& s1,
  169.                                     const CString& s2);
  170.  
  171.     friend Boolean operator<(const CString& s1,
  172.                                     const char* s2);
  173.     friend Boolean operator<(const char* s1,
  174.                                     const CString& s2);
  175.     friend Boolean operator<(const CString& s1,
  176.                                     const CString& s2);
  177.  
  178.     friend Boolean operator>=(const CString& s1,
  179.                                      const char* s2);
  180.     friend Boolean operator>=(const char* s1,
  181.                                      const CString& s2);
  182.     friend Boolean operator>=(const CString& s1,
  183.                                      const CString& s2);
  184.  
  185.     friend Boolean operator<=(const CString& s1,
  186.                                      const char* s2);
  187.     friend Boolean operator<=(const char* s1,
  188.                                      const CString& s2);
  189.     friend Boolean operator<=(const CString& s1,
  190.                                      const CString& s2);
  191.  
  192.     // Concatenation operator that are inherited by all the derived CString types. Three
  193.     // of each so that literal C Strings can be conveniently used for one of the operators
  194.     // as well as using any two classes derived from CString.
  195.  
  196.     friend CStr255 operator+(const CString& s1,
  197.                             const char* s2);
  198.     friend CStr255 operator+(const char* s1,
  199.                             const CString& s2);
  200.     friend CStr255 operator+(const CString& s1,
  201.                             const CString& s2);
  202.  
  203.     // Methods that mimic the Pascal builtin CString functions for Pos, Insert and Delete.
  204.     // Note that insert and copy is implemented in the derived classes.
  205.  
  206.     unsigned char Pos(const char* subStr, unsigned char startPos = 1);
  207.     unsigned char Pos(const CString& subStr, unsigned char startPos = 1);
  208.     inline void Delete(short pos, short length);
  209. };
  210.  
  211.  
  212. //----------------------------------------------------------------------------------------
  213. // CStr255:
  214. //----------------------------------------------------------------------------------------
  215.  
  216. struct CStr255 : CString
  217. {
  218.  
  219.     friend struct CStr63;
  220.     friend struct CStr31;
  221.  
  222. private:
  223.     unsigned char fData[kStr255Len - 1];
  224.  
  225. public:
  226.     CStr255();
  227.     CStr255(const CStr255& str);
  228.     CStr255(const CStr63& str);
  229.     CStr255(const CStr32& str);
  230.     CStr255(const CStr31& str);
  231.     CStr255(const unsigned char* str);
  232.     CStr255(const char* str);
  233.     CStr255(const long id);
  234.  
  235.     // Insert and Copy roughly equivalent to the Pascal Insert and Copy functions.
  236.     
  237.     void Insert(const CString& str, short pos);
  238.     void Insert(const char* str, short pos);
  239.     CStr255 Copy(short pos, short length);
  240.                        
  241.     // Concatenation operator
  242.     
  243.     CStr255& operator +=(const CString& str);
  244.     CStr255& operator +=(const char* str);
  245.     CStr255& operator +=(const char ch);
  246.  
  247.     // Assignment operator
  248.  
  249.     CStr255& operator =(const CStr255& str);
  250.     CStr255& operator =(const CStr63& str);
  251.     CStr255& operator =(const CStr32& str);
  252.     CStr255& operator =(const CStr31& str);
  253.     CStr255& operator =(const unsigned char* str);
  254.     CStr255& operator =(const char aChar);
  255.     CStr255& operator =(const char* str);
  256.     
  257. };
  258.  
  259.  
  260. //----------------------------------------------------------------------------------------
  261. // CStr63:
  262. //----------------------------------------------------------------------------------------
  263.  
  264. struct CStr63 : CString
  265. {
  266.  
  267.     friend struct CStr255;
  268.     friend struct CStr31;
  269.  
  270. private:
  271.     unsigned char fData[kStr63Len - 1];
  272.  
  273. public:
  274.     CStr63();
  275.     CStr63(const CStr255& str);
  276.     CStr63(const CStr63& str);
  277.     CStr63(const CStr32& str);
  278.     CStr63(const CStr31& str);
  279.     CStr63(const unsigned char* str);
  280.     CStr63(const char* str);
  281.     CStr63(const long id);
  282.  
  283.     // Insert and Copy roughly equivalent to the Pascal Insert and Copy functions.
  284.     
  285.     void Insert(const CString& str,
  286.                        short pos);
  287.     void Insert(const char* str,
  288.                        short pos);
  289.     CStr63 Copy(short pos, short length);
  290.  
  291.     // Concatenation operator
  292.     
  293.     CStr63& operator +=(const CString& str);
  294.     CStr63& operator +=(const char* str);
  295.     CStr63& operator +=(const char ch);
  296. };
  297.  
  298.  
  299. //----------------------------------------------------------------------------------------
  300. // CStr32:
  301. //----------------------------------------------------------------------------------------
  302.  
  303. struct CStr32 : CString
  304. {
  305.  
  306.     friend struct CStr255;
  307.     friend struct CStr63;
  308.  
  309. private:
  310.     unsigned char fData[kStr32Len - 1];
  311.  
  312. public:
  313.     CStr32();
  314.     inline CStr32(unsigned char length)
  315.     {
  316.         fStr[0] = length;
  317.     }
  318.  
  319.  
  320.     CStr32(const CStr255& str);
  321.     CStr32(const CStr63& str);
  322.     CStr32(const CStr32& str);
  323.     CStr32(const CStr31& str);
  324.     CStr32(const unsigned char* str);
  325.     CStr32(const char* str);
  326.     CStr32(const long id);
  327.  
  328.  
  329.     // Insert and Copy roughly equivalent to the Pascal Insert and Copy functions.
  330.     
  331.     void Insert(const CString& str,
  332.                        short pos);
  333.     void Insert(const char* str,
  334.                        short pos);
  335.     CStr32 Copy(short pos, short length);
  336.  
  337.     // Concatenation operator
  338.     
  339.     CStr32& operator +=(const CString& str);
  340.     CStr32& operator +=(const char* str);
  341.     CStr32& operator +=(const char ch);
  342. };
  343.  
  344.  
  345. //----------------------------------------------------------------------------------------
  346. // CStr31:
  347. //----------------------------------------------------------------------------------------
  348.  
  349. struct CStr31 : CString
  350. {
  351.  
  352.     friend struct CStr255;
  353.     friend struct CStr63;
  354.     friend struct CStr32;
  355.  
  356. private:
  357.     unsigned char fData[kStr31Len - 1];
  358.  
  359. public:
  360.     CStr31();
  361.     inline CStr31(unsigned char length)
  362.     {
  363.         fStr[0] = length;
  364.     }
  365.  
  366.  
  367.     CStr31(const CStr255& str);
  368.     CStr31(const CStr63& str);
  369.     CStr31(const CStr32& str);
  370.     CStr31(const CStr31& str);
  371.     CStr31(const unsigned char* str);
  372.     CStr31(const char* str);
  373.     CStr31(const long id);
  374.  
  375.     // Insert and Copy roughly equivalent to the Pascal Insert and Copy functions.
  376.     
  377.     void Insert(const CString& str,
  378.                        short pos);
  379.     void Insert(const char* str,
  380.                        short pos);
  381.     CStr31 Copy(short pos, short length);
  382.  
  383.     // Concatenation operator
  384.     
  385.     CStr31& operator +=(const CString& str);
  386.     CStr31& operator +=(const char* str);
  387.     CStr31& operator +=(const char ch);
  388. };
  389.  
  390.  
  391. //----------------------------------------------------------------------------------------
  392. // CString inline function definitions
  393. //----------------------------------------------------------------------------------------
  394.  
  395. inline CString::operator unsigned char*()
  396. {
  397.     return (unsigned char *) this;
  398. }
  399.  
  400. inline CString::operator const unsigned char*() const
  401. {
  402.     return (const unsigned char *) this;
  403. }
  404.  
  405. inline void CString::Delete(short pos, short length)
  406. {
  407.     if ((pos > 0) && (length > 0) && (pos <= Length()))    // should also check that pos <= kMaxLength
  408.     {
  409.         if (pos + length > Length())
  410.             fStr[0] = pos - 1;
  411.         else
  412.         {
  413.             memcpy(&fStr[pos], &fStr[pos + length], Length() - (pos + length) + kLengthByte);
  414.             fStr[0] -= length;
  415.         }
  416.     }
  417. }
  418.  
  419.  
  420. //----------------------------------------------------------------------------------------
  421. // CStr255 inline function definitions
  422. //----------------------------------------------------------------------------------------
  423.  
  424. inline CStr255::CStr255()
  425. {
  426. }
  427.  
  428. inline CStr255::CStr255(const CStr255& str)
  429. {
  430.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  431. }
  432.  
  433. inline CStr255::CStr255(const CStr63& str)
  434. {
  435.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  436. }
  437.  
  438. inline CStr255::CStr255(const CStr32& str)
  439. {
  440.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  441. }
  442.  
  443. inline CStr255::CStr255(const CStr31& str)
  444. {
  445.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  446. }
  447.  
  448. inline CStr255::CStr255(const unsigned char* str)
  449. {
  450.     memcpy(fStr, str, kStr255Len + kLengthByte);
  451. }
  452.  
  453. inline CStr255& CStr255::operator = (const CStr255& str)
  454. {
  455.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  456.     
  457.     return *this;
  458. }
  459.  
  460. inline CStr255& CStr255::operator = (const CStr63& str)
  461. {
  462.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  463.     
  464.     return *this;
  465. }
  466.  
  467. inline CStr255& CStr255::operator = (const CStr32& str)
  468. {
  469.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  470.     
  471.     return *this;
  472. }
  473.  
  474. inline CStr255& CStr255::operator = (const CStr31& str)
  475. {
  476.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  477.     
  478.     return *this;
  479. }
  480.  
  481. inline CStr255& CStr255::operator = (const unsigned char* str)
  482. {
  483.     memcpy(fStr, str, kStr255Len + kLengthByte);
  484.     
  485.     return *this;
  486. }
  487.  
  488. inline CStr255& CStr255::operator = (const char aChar)
  489. {
  490.     if (aChar == '\0')                        // passing in an NULL char
  491.         Length() = 0;
  492.     else
  493.     {
  494.         Length() = 1;                        // CString gets length of 1
  495.         fStr[1] = aChar;                    // assign in the character
  496.     }
  497.     
  498.     return *this;
  499. }
  500.  
  501. inline void CStr255::Insert(const CString& str, short pos)
  502. {
  503.     InsertHelper(str, pos, kStr255Len);
  504. }
  505.  
  506. inline void CStr255::Insert(const char* str, short pos)
  507. {
  508.     InsertHelper(str, pos, kStr255Len);
  509. }
  510.  
  511.  
  512. //----------------------------------------------------------------------------------------
  513. // CStr63 inline function definitions
  514. //----------------------------------------------------------------------------------------
  515.  
  516. inline CStr63::CStr63()
  517. {
  518. }
  519.  
  520. inline CStr63::CStr63(const CStr255& str)
  521. {
  522.     // Truncate the CStr255 to 63 bytes if necessary.
  523.  
  524.     Length() = str.Length() > kStr63Len ? kStr63Len : str.Length();
  525.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  526. }
  527.  
  528. inline CStr63::CStr63(const CStr63& str)
  529. {
  530.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  531. }
  532.  
  533. inline CStr63::CStr63(const CStr32& str)
  534. {
  535.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  536. }
  537.  
  538. inline CStr63::CStr63(const CStr31& str)
  539. {
  540.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  541. }
  542.  
  543. inline CStr63::CStr63(const unsigned char* str)
  544. {
  545.     memcpy(fStr, str, kStr63Len + kLengthByte);
  546. }
  547.  
  548. inline void CStr63::Insert(const CString& str, short pos)
  549. {
  550.     InsertHelper(str, pos, kStr63Len);
  551. }
  552.  
  553. inline void CStr63::Insert(const char* str, short pos)
  554. {
  555.     InsertHelper(str, pos, kStr63Len);
  556. }
  557.  
  558.  
  559. //----------------------------------------------------------------------------------------
  560. // CStr32 inline function definitions
  561. //----------------------------------------------------------------------------------------
  562.  
  563. inline CStr32::CStr32()
  564. {
  565. }
  566.  
  567. inline CStr32::CStr32(const CStr255& str)
  568. {
  569.     // Truncate the CStr255 to 32 bytes if necessary.
  570.  
  571.     Length() = str.Length() > kStr32Len ? kStr32Len : str.Length();
  572.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  573. }
  574.  
  575. inline CStr32::CStr32(const CStr63& str)
  576. {
  577.     // Truncate the CStr63 to 32 bytes if necessary.
  578.  
  579.     Length() = str.Length() > kStr32Len ? kStr32Len : str.Length();
  580.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  581. }
  582.  
  583. inline CStr32::CStr32(const CStr32& str)
  584. {
  585.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  586. }
  587.  
  588. inline CStr32::CStr32(const CStr31& str)
  589. {
  590.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  591. }
  592.  
  593. inline CStr32::CStr32(const unsigned char* str)
  594. {
  595.     memcpy(fStr, str, kStr31Len + kLengthByte);
  596. }
  597.  
  598. inline void CStr32::Insert(const CString& str, short pos)
  599. {
  600.     InsertHelper(str, pos, kStr32Len);
  601. }
  602.  
  603. inline void CStr32::Insert(const char* str, short pos)
  604. {
  605.     InsertHelper(str, pos, kStr32Len);
  606. }
  607.  
  608.  
  609. //----------------------------------------------------------------------------------------
  610. // CStr31 inline function definitions
  611. //----------------------------------------------------------------------------------------
  612.  
  613. inline CStr31::CStr31()
  614. {
  615. }
  616.  
  617. inline CStr31::CStr31(const CStr255& str)
  618. {
  619.     // Truncate the CStr255 to 31 bytes if necessary.
  620.  
  621.     Length() = str.Length() > kStr31Len ? kStr31Len : str.Length();
  622.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  623. }
  624.  
  625. inline CStr31::CStr31(const CStr63& str)
  626. {
  627.     // Truncate the CStr63 to 31 bytes if necessary.
  628.  
  629.     Length() = str.Length() > kStr31Len ? kStr31Len : str.Length();
  630.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  631. }
  632.  
  633. inline CStr31::CStr31(const CStr32& str)
  634. {
  635.     // Truncate the CStr32 to 31 bytes if necessary.
  636.  
  637.     Length() = str.Length() > kStr31Len ? kStr31Len : str.Length();
  638.     memcpy(fStr, str.fStr, Length() + kLengthByte);
  639. }
  640.  
  641. inline CStr31::CStr31(const CStr31& str)
  642. {
  643.     memcpy(fStr, str.fStr, str.Length() + kLengthByte);
  644. }
  645.  
  646. inline CStr31::CStr31(const unsigned char* str)
  647. {
  648.     memcpy(fStr, str, kStr31Len + kLengthByte);
  649. }
  650.  
  651. inline void CStr31::Insert(const CString& str, short pos)
  652. {
  653.     InsertHelper(str, pos, kStr31Len);
  654. }
  655.  
  656. inline void CStr31::Insert(const char* str, short pos)
  657. {
  658.     InsertHelper(str, pos, kStr31Len);
  659. }
  660.  
  661.  
  662. /*
  663. //----------------------------------------------------------------------------------------
  664. // Inline friend function definitions for relational string operators.
  665. //----------------------------------------------------------------------------------------
  666.  
  667. inline Boolean operator==(const CString& s1, const char* s2)
  668. {
  669.     return RelString(s1, CStr255(s2), false, true) == 0;
  670. }
  671.  
  672. inline Boolean operator==(const char* s1, const CString& s2)
  673. {
  674.     return RelString(CStr255(s1), s2, false, true) == 0;
  675. }
  676.  
  677. inline Boolean operator==(const CString& s1, const CString& s2)
  678. {
  679.     return RelString(s1, s2, false, true) == 0;
  680. }
  681.  
  682. inline Boolean operator!=(const CString& s1, const char* s2)
  683. {
  684.     return RelString(s1, CStr255(s2), false, true) != 0;
  685. }
  686.  
  687. inline Boolean operator!=(const char* s1, const CString& s2)
  688. {
  689.     return RelString(CStr255(s1), s2, false, true) != 0;
  690. }
  691.  
  692. inline Boolean operator!=(const CString& s1, const CString& s2)
  693. {
  694.     return RelString(s1, s2, false, true) != 0;
  695. }
  696.  
  697. inline Boolean operator>(const CString& s1, const char* s2)
  698. {
  699.     return RelString(s1, CStr255(s2), false, true) > 0;
  700. }
  701.  
  702. inline Boolean operator>(const char* s1, const CString& s2)
  703. {
  704.     return RelString(CStr255(s1), s2, false, true) > 0;
  705. }
  706.  
  707. inline Boolean operator>(const CString& s1, const CString& s2)
  708. {
  709.     return RelString(s1, s2, false, true) > 0;
  710. }
  711.  
  712. inline Boolean operator<(const CString& s1, const char* s2)
  713. {
  714.     return RelString(s1, CStr255(s2), false, true) < 0;
  715. }
  716.  
  717. inline Boolean operator<(const char* s1, const CString& s2)
  718. {
  719.     return RelString(CStr255(s1), s2, false, true) < 0;
  720. }
  721.  
  722. inline Boolean operator<(const CString& s1, const CString& s2)
  723. {
  724.     return RelString(s1, s2, false, true) < 0;
  725. }
  726.  
  727. inline Boolean operator>=(const CString& s1, const char* s2)
  728. {
  729.     return RelString(s1, CStr255(s2), false, true) >= 0;
  730. }
  731.  
  732. inline Boolean operator>=(const char* s1, const CString& s2)
  733. {
  734.     return RelString(CStr255(s1), s2, false, true) >= 0;
  735. }
  736.  
  737. inline Boolean operator>=(const CString& s1, const CString& s2)
  738. {
  739.     return RelString(s1, s2, false, true) >= 0;
  740. }
  741.  
  742. inline Boolean operator<=(const CString& s1, const char* s2)
  743. {
  744.     return RelString(s1, CStr255(s2), false, true) <= 0;
  745. }
  746.  
  747. inline Boolean operator<=(const char* s1, const CString& s2)
  748. {
  749.     return RelString(CStr255(s1), s2, false, true) <= 0;
  750. }
  751.  
  752. inline Boolean operator<=(const CString& s1, const CString& s2)
  753. {
  754.     return RelString(s1, s2, false, true) <= 0;
  755. }
  756. */
  757.  
  758.  
  759. #endif
  760.  
  761.